<?php
class LogMoreController extends LogBaseController{
	public function __construct(){
		parent::__construct();
	}
	
	public function showList(){
		$manager = new LogManager();
		$returnList = $manager->pageShow("list",'logShowListMore');
		$this->tpl->assign('exportLog', ture);
		$this->tpl->assign('returnList', $returnList);
		$this->tpl->assign('pageHtml', $returnList["pageHtml"]);
		$this->tpl->assign('tableTitle', $returnList["tableTitle"]);
		$this->tpl->assign('tableValue', $returnList["tableValue"]);
		$this->tpl->assign('pageName', $returnList["pageName"]);
		$this->tpl->assign('pageKey', $returnList["pageKey"]);
		$this->tpl->assign('searchCase', $returnList["searchCase"]);
		$this->tpl->assign('showLogMaxError', $returnList['totle'] >= LOGMAXCOUNT);

		$exportUrlList = explode("/?", $_SERVER['REQUEST_URI']);
		$this->tpl->assign('exportUrl', $exportUrlList[1]);
		
		$this->tpl->assign('controllerName', "logShowListMore");
		
		$this->tpl->display("log/logShow.html");
	}
	
	public function showMore(){
		$manager = new LogManager();
		$returnList = $manager->moreShow('logShowListMore');
		
		$this->tpl->assign('table', $returnList["data"]);
		$this->tpl->assign('pageKey', $returnList["pageKey"]);
		$this->tpl->assign('pageName', $returnList["pageName"]);
		
		$this->tpl->display("log/showMore.html");
	}
	
	public function showImg(){
		$manager = new LogManager();
		$returnList = $manager->moreImg();
	}
	
	public function setLogMaxCount(){
		$this->tpl->assign('logMaxCount', LOGMAXCOUNT);
		$this->tpl->display("log/setLogMaxCount.html");
	}

	public function setLogMaxCountAction(){
		$logMaxCount = $_POST['logMaxCount'];
		if (!is_numeric($logMaxCount)) {
			$msg = '请输入正确格式的数字！';
		}else{
			$manager = new setLogMaxCountManager();
			$msg = $manager->writeLogMaxCountFile($logMaxCount);
		}

		Handler_tool::alertAndRedirect($msg, HTTPFILEURL.'/logShowListMore/setLogMaxCount/');
	}
}